﻿Public Class vwHoaDonMoi
    Public Overrides Function ToString() As String
        Return MyBase.ToString()
    End Function

    Private _MaHoaDon As String
    Property MaHoaDon As String
        Get
            Return Me.NgayLap.ToString("MM/yy") + "/" + Me.SoHoaDon.ToString.PadLeft(My.Settings.SoSoKhongHoaDon, "0")
        End Get
        Set(value As String)
            _MaHoaDon = value
        End Set
    End Property

    Private _TongTienChuaGiamGia As Decimal
    Public Property TongTienChuaGiamGia() As Decimal
        Get
            Return dt.tbHoaDons.Where(Function(s) s.id = Me.id).Select(Function(s) s.TongTienChuaGiamGia).First
        End Get
        Set(ByVal value As Decimal)
            _TongTienChuaGiamGia = value
        End Set
    End Property

    Private _TongTienDaGiamGia As Decimal
    Public Property TongTienDaGiamGia() As Decimal
        Get
            Return dt.tbHoaDons.Where(Function(s) s.id = Me.id).Select(Function(s) s.TongTienDaGiamGia).First
        End Get
        Set(ByVal value As Decimal)
            _TongTienDaGiamGia = value
        End Set
    End Property

End Class
